@layout("/common/_container.html",{js:["/assets/modular/system/project/project_shangwu.js"]}){
<style>
    .input {
        border: none;
    }

    .editinput {
        width: 60px;
    }

    .address {
        width: 200px;
    }

    .bz {
        width: 600px;
    }

    .layui-table tbody tr:hover,
    .layui-table thead tr,
    .layui-table-click,
    .layui-table-header,
    .layui-table-hover,
    .layui-table-mend,
    .layui-table-patch, .layui-table-tool,
    .layui-table-total, .layui-table-total tr, .layui-table[lay-even] tr:nth-child(even) {
        background-color: #FFFFFF;
    }

    td {
        white-space: nowrap;
    }

    .btnshop {
        display: inline-block;
        height: 38px;
        line-height: 38px;
        padding: 0 18px;
        background-color: #009688;
        color: #fff;
        white-space: nowrap;
        text-align: center;
        font-size: 14px;
        border: none;
        border-radius: 2px;
        cursor: pointer;
        margin-bottom: 10px;
    }

    .blur {
        border: 1px solid red;
    }

    .testdiv {
        margin-bottom: 10px;
    }

    .xmdz {
        width: 555px;
    }

    .ylt {
        width: 80%;
        margin-top: 10px;
        display: inline-block
    }

    .ggylt {
        margin-left: -117px;
        width: 132%;
        margin-top: 10px;
        display: inline-block;
    }

    .sjspan {
        padding-right: 15px;
    }
    .uploader-list {
        margin-left: -15px;
    }
    .uploader-list .info {
        position: relative;
        margin-top: -25px;
        background-color: black;
        color: white;
        filter: alpha(Opacity=80);
        -moz-opacity: 0.5;
        opacity: 0.5;
        width: 80px;
        height: 25px;
        text-align: center;
        display: none;
    }
    .uploader-list .handle {
        position: relative;
        background-color: black;
        color: white;
        filter: alpha(Opacity=80);
        -moz-opacity: 0.5;
        opacity: 0.5;
        width: 80px;
        text-align: right;
        height: 25px;
        margin-bottom: -18px;
        display: none;
    }

    .uploader-list .handle span {
        margin-right: 10px;
        font-size: 14px;
    }

    .uploader-list .handle span:hover {
        cursor: pointer;
    }

    .uploader-list .file-iteme {
        margin: 12px 0 0 15px;
        padding: 1px;
        float: left;
    }
    html {
        background-color: #FFF;
        overflow-x:scroll;
    }
</style>
</head>
<body>
<form id="noticeForm" lay-filter="noticeForm">
    <div class="testdiv">
        <table class="layui-table" style="width: 50%;margin: 0 auto" id="tables">
            <tbody>
            <tr>
                <td colspan="4">项目地址: <input class="input xmdz" id="itemAddress" name="txt36" autocomplete="off"/>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <input type="hidden" name="zswztimg" id="zswztimg" class="msg">
                            <div class="layui-upload" style="display: inline-block;width: 82%;margin-right: 15px">
                                <blockquote class="layui-elem-quote layui-quote-nm ylt">
                                    预览图：
                                    <div class="layui-upload-list uploader-list" style="overflow: auto;"
                                         id="uploader-list-zswztimg">
                                    </div>

                                </blockquote>
                                <div style="display: inline-block;margin-left: 10px" class="change">
                                    <button type="button" class="layui-btn ws" id="many_zswztimg_upload_btn">上传落位图
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </td>
            </tr>
            <div id="contact">
                <tr>
                    <td rowspan="3" style="width: 10%">
                        <span>相关人员通讯录</span>
                    </td>
                    <td style="width: 10%">
                        职位
                    </td>
                    <td style="width: 10%">
                        姓名
                    </td>
                    <td style="width: 10%">
                        电话
                    </td>
                </tr>
                <tr>
                    <td>
                        半天妖开发人员
                    </td>
                    <td>
                        <input class=" editinput input" id="kfry" name="txt35" autocomplete="off" style="width: 100px"/>
                    </td>
                    <td>
                        <input class=" editinput input" id="ry" style="width: 120px" name="txt34" autocomplete="off" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        招商负责人
                    </td>
                    <td>
                        <input class="input editinput" id="sw" name="txt33" autocomplete="off" style="width: 100px"/>
                    </td>
                    <td>
                        <input class="input editinput" id="djr" style="width: 120px" name="txt32" autocomplete="off" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')">
                    </td>
                </tr>
            </div>


            <div id="">
                <tr>
                    <td rowspan="23" style="width: 10%"><span style="color: red">*</span>商务主要条款</td>
                    <td>租赁面积</td>
                    <td colspan="2"><input class="input editinput Mj" id="swzl" name="txt31" autocomplete="off"/>㎡</td>
                </tr>
                <tr>
                    <td>外摆区面积</td>
                    <td colspan="2"><input class="input editinput Mj" id="hxwmj" name="txt30" autocomplete="off"/>㎡</td>
                </tr>
                <tr>
                    <td>租赁时间</td>
                    <td colspan="2">
                        <input class="input editinput" id="zlTime" name="txt300" autocomplete="off" onkeyup="clearNoNum(this)"/>个月
                        <input class="input editinput" id="zlTime1" name="txt3000" autocomplete="off" onkeyup="clearNoNum(this)"/>天
                    </td>
                </tr>
                <tr>
                    <td>免租时间</td>
                    <td colspan="2">
                        <input class="input editinput" id="mzTime" name="txt3000" autocomplete="off" onkeyup="clearNoNum(this)"/>个月
                        <input class="input editinput" id="mzTime1" name="txt300000" autocomplete="off" onkeyup="clearNoNum(this)"/>天
                    </td>
                </tr>
                <tr>
                    <td rowspan="12" style="text-align: center">租金</td>
                    <td colspan="2">第1年<input class="input editinput Mj" id="oneYear"
                                              name="txt27" autocomplete="off"
                                              style="text-align: center;"
                    />元（人民币）/月
                    </td>
                </tr>
                <tr>
                    <td colspan="2">第2年<input class="input editinput Mj" id="twoYear" style="text-align: center;"
                                              name="txt26" autocomplete="off"/>元（人民币）/月
                    </td>
                </tr>
                <tr>
                    <td colspan="2">第3年<input class="input editinput Mj" id="treeYear" style="text-align: center;"
                                              name="txt25" autocomplete="off"/>元（人民币）/月
                    </td>
                </tr>
                <tr>
                    <td colspan="2">第4年<input class="input editinput Mj" id="foreYear" style="text-align: center;"
                                              name="txt24" autocomplete="off"/>元（人民币）/月
                    </td>
                </tr>
                <tr>
                    <td colspan="2">第5年<input class="input editinput Mj" id="fiveYear" style="text-align: center;"
                                              name="txt23" autocomplete="off"/>元（人民币）/月
                    </td>
                </tr>
                <tr>
                    <td colspan="2">第6年<input class="input editinput Mj" id="sixYear" style="text-align: center;"
                                              name="txt22" autocomplete="off"/>元（人民币）/月
                    </td>
                </tr>
                <tr>
                    <td colspan="2">第7年<input class="input editinput Mj" id="sevenYear" style="text-align: center;"
                                              name="txt21" autocomplete="off"/>元（人民币）/月
                    </td>
                </tr>
                <tr>
                    <td colspan="2">第8年<input class="input editinput Mj" id="eightYear" style="text-align: center;"
                                              name="txt20" autocomplete="off"/>元（人民币）/月
                    </td>
                </tr>
                <tr>
                    <td colspan="2">第9年<input class="input editinput Mj" id="nineYear" style="text-align: center;"
                                              name="txt19" autocomplete="off"/>元（人民币）/月
                    </td>
                </tr>
                <tr>
                    <td colspan="2">第10年<input class="input editinput Mj" id="tenYear" style="text-align: center;"
                                               name="txt18" autocomplete="off"/>元（人民币）/月
                    </td>
                </tr>
                <tr>
                    <td>抽成形式</td>
                    <td><input class="input editinput Mj" id="ccxst" name="txt17" autocomplete="off" value="0"/>%</td>
                </tr>
                <tr>
                    <td>其他形式</td>
                    <td><input class="input address" id="qt" name="txt16" autocomplete="off" value="无"/></td>
                </tr>
                <tr>
                    <td>水费</td>
                    <td colspan="2"><input class="input editinput Mj" id="sf" name="txt15" autocomplete="off" value="0" />元（人民币）/吨
                    </td>
                </tr>
                <tr>
                    <td>电费</td>
                    <td colspan="2"><input class="input editinput Mj" id="df" name="txt14" autocomplete="off" value="0"/>元（人民币）/度
                    </td>
                </tr>
                <tr>
                    <td>物业费</td>
                    <td colspan="2"><input class="input editinput Mj" id="wuyf" name="txt13" autocomplete="off" value="0"/>元（人民币）/月
                    </td>
                </tr>
                <tr>
                    <td>质量保证金</td>
                    <td colspan="2"><input class="input editinput Mj" id="bzj" name="txt12" autocomplete="off" value="0"/>元（人民币）
                    </td>
                </tr>
                <tr>
                    <td>租赁保证金</td>
                    <td colspan="2"><input class="input editinput Mj" id="zlbzj" name="txt11" autocomplete="off"
                                           value="0"/>元（人民币）
                    </td>
                </tr>
                <tr>
                    <td>物业保证金</td>
                    <td colspan="2"><input class="input editinput Mj" id="wybzj" name="txt10" autocomplete="off"
                                           value="0"/>元（人民币）
                    </td>
                </tr>
                <tr>
                    <td>其他</td>
                    <td colspan="2"><input class="input editinput" id="qtbzj" name="txt9" autocomplete="off" value="无"/>
                    </td>
                </tr>
            </div>
            <div id="ggwz">
                <tr>
                    <td rowspan="4">广告位置</td>
                    <td class="ad">位置：<input class="input address ad" id="wz" name="txt8" autocomplete="off"/>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="btwpztimg" id="btwpztimg" class="msg">
                                <div class="layui-upload" style="display: inline-block;width: 82%;margin-right: 15px">
                                    <blockquote class="layui-elem-quote layui-quote-nm ggylt">
                                        预览图：
                                        <div class="layui-upload-list uploader-list" style="overflow: auto;"
                                             id="uploader-list-btwpztimg"></div>
                                    </blockquote>
                                    <div style="display: inline-block;margin-left: 10px" class="change">
                                        <button type="button" class="layui-btn ws" id="many_btwpztimg_upload_btn">上传
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </td>
                    <td colspan="2">租金：<input class="input editinput Mj" id="zj" name="txt7" autocomplete="off"/>元/月</td>
                </tr>
                <tr>
                    <td class="ad">位置：<input class="input address" id="wz1" name="txt6" autocomplete="off"/>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="qtztimg" id="qtztimg" class="msg">
                                <div class="layui-upload" style="display: inline-block;width: 82%;margin-right: 15px">
                                    <blockquote class="layui-elem-quote layui-quote-nm ggylt">
                                        预览图：
                                        <div class="layui-upload-list uploader-list" style="overflow: auto;"
                                             id="uploader-list-qtztimg"></div>
                                    </blockquote>
                                    <div style="display: inline-block;margin-left: 10px" class="change">
                                        <button type="button" class="layui-btn ws" id="many_qtztimg_upload_btn">上传
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </td>
                    <td colspan="2">租金：<input class="input editinput Mj" id="zj1" name="txt5" autocomplete="off"/>元/月</td>
                </tr>
                <tr>
                    <td class="ad">位置：<input class="input address" id="wz2" name="txt4" autocomplete="off"/>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="zztztimg" id="zztztimg" class="msg">
                                <div class="layui-upload" style="display: inline-block;width: 82%;margin-right: 15px">
                                    <blockquote class="layui-elem-quote layui-quote-nm ggylt">
                                        预览图：
                                        <div class="layui-upload-list uploader-list" style="overflow: auto;"
                                             id="uploader-list-zztztimg"></div>
                                    </blockquote>
                                    <div style="display: inline-block;margin-left: 10px" class="change">
                                        <button type="button" class="layui-btn ws" id="many_zztztimg_upload_btn">上传
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </td>
                    <td colspan="2">租金：<input class="input editinput Mj" id="zj2" name="txt3" autocomplete="off"/>元/月</td>
                </tr>
                <tr>
                    <td class="ad">位置：<input class="input address" id="wz3" name="txt2" autocomplete="off"/>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="hidden" name="cjztimg" id="cjztimg" class="msg">
                                <div class="layui-upload" style="display: inline-block;width: 82%;margin-right: 15px">
                                    <blockquote class="layui-elem-quote layui-quote-nm ggylt">
                                        预览图：
                                        <div class="layui-upload-list uploader-list" style="overflow: auto;"
                                             id="uploader-list-cjztimg"></div>
                                    </blockquote>
                                    <div style="display: inline-block;margin-left: 10px" class="change">
                                        <button type="button" class="layui-btn ws" id="many_cjztimg_upload_btn">上传
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </td>
                    <td colspan="2">租金：<input class="input editinput Mj" id="zj3" name="txt1" autocomplete="off"/>元/月</td>
                </tr>
            </div>
            <div>
                <tr>
                    <td>备注</td>
                    <td colspan="3"><input class="input bz" id="remarks" name="txt" autocomplete="off"/></td>
                </tr>
            </div>
            </tbody>
        </table>
    </div>
</form>
<div class="layui-input-block">
    <input type="button" class="btnshop" id="export" name="Submit" value="导出" onclick="table2excel()"/>
    <input type="button" class="btnshop change" id="btnKeep" name="Submit" value="保存"/>
    <input type="button" class="btnshop" id="past" name="Submit" value="通过"/>
    <input type="button" class="btnshop" id="reject" name="Submit" value="驳回"/>
    <input type="button" class="btnshop" id="backupPage" name="Submit" value="返回"/>
<!--    <input type="button" class="btnshop" id="add" name="Submit" value="测试添加"/>-->
</div>
</body>

<script src="https://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/sisyphus.js/1.1.103/sisyphus.min.js"></script>
<script type="application/javascript">
    // $('#add').click(function () {
    //     $('.input').val('测试');
    //     $("input[type='radio']").attr("checked", true);
    // });

    let timeout;
    function throttling(){
        //先清理
        clearTimeout(timeout)
        timeout = setTimeout(() => {
            //在此处写调用的方法，可以实现仅最后一次操作生效
            console.log('abc')
        }, 1000)
    }

    // 文本框只能输入大于0的整数
    function clearNoNum(obj) {
        //obj.value = obj.value.replace(/[^\d]/g, "");//清除“数字“以外的字符
        if (obj.value.length == 1) {
            obj.value = obj.value.replace(/[^1-9]/g, '');
        } else {
            obj.value = obj.value.replace(/\D/g, '');
        }
        obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");//替换调其他字母或者.等
    }

    // 保留两位小数
    $(".Mj").keyup(function(){
        var reg = /^\d+\.?(\d{1,2})?$/;
        while (!reg.test($(this).val()) && $(this).val() != "") {
            $(this).val(checkStr($(this).val()));
        }
    });

    //检查是否符合金额格式:只能输入数字且最多保留小数点后两位
    function checkStr(str) {
        str = str.substring(0,str.length-1);
        return str;
    }


    // 导出表格
    function table2excel() {
        $("#tables tr td").each(function (index, el) {
            if ($(this).find('input').length) {
                // 存在 input
                $(this).find('input').attr('value', $(this).find('input').val());
            }
        });
        $("#tables").table2excel({
            // 不被导出的表格行的CSS class类
            exclude: ".noExl",
            // 导出的Excel文档的名称
            name: "商务条件表",
            // Excel文件的名称
            filename: "商务条件表",
            //文件后缀名
            fileext: ".xls",
            //是否排除导出图片
            exclude_img: false,
            //是否排除导出超链接
            exclude_links: false,
            //是否排除导出输入框中的内容
            exclude_inputs: true
        });
    }

    const id = '${id}';
    const swedit = '${swedit}';
    const lists = [${list}];
    const auditbtn = [${auditbtn}];

    $(function () {
        if (auditbtn != 1) {
            $("#past").hide();
            $("#reject").hide();
        }
        // 保存草稿
        $("#noticeForm").sisyphus({
            locationBased: true,
            customKeySuffix: "test"
        });

        for (let i = 0; i < lists[0][0].length; i++) {
            let pinCode = lists[0][0][i].pinCode;
            $("#" + pinCode + "").val(lists[0][0][i].data);
            if (swedit != 1) {
                $("#" + pinCode + "").attr("readonly", true);
                $("#" + pinCode + "").removeAttr('id');
                $('.change').hide();
                $('.file-iteme').children(".handle").hide()
            }
            if (pinCode == "zswztimg") {
                let a = lists[0][0][i].data.split(",");
                for (let j = 0; j < a.length; j++) {
                    $("#uploader-list-zswztimg").append('<div id="pic" class="file-iteme">' +
                        '<div class="handle"><span class="layui-icon">点击删除</span></div>' +
                        "<div class='gs-upload-file-container'>"+
                        "<div class='gs-upload-ele'>"+
                        "<div class='progress-bar progress-bar-success progress-bar-striped gs-upload-progress-bar' style='width: 188px; display: none;'></div>" +
                        "<div class='gs-upload-ele-img-div'>"+
                        '<img src="' + a[j] + '" style="width: 80px;height: 80px;"/>'+
                        "</div>	"+
                        "<div class='gs-upload-ele-content'>"+
                        "<div class='gs-upload-ele-title-div'></div>"+
                        "<div class='gs-upload-ele-menu'>"+
                        "</div></div></div></div></div>");
                }
            } else if (pinCode == "btwpztimg") {
                let a = lists[0][0][i].data.split(",");
                for (let j = 0; j < a.length; j++) {
                    $("#uploader-list-btwpztimg").append('<div id="pic" class="file-iteme">' +
                        '<div class="handle"><span class="layui-icon">点击删除</span></div>' +
                        "<div class='gs-upload-file-container'>"+
                        "<div class='gs-upload-ele'>"+
                        "<div class='progress-bar progress-bar-success progress-bar-striped gs-upload-progress-bar' style='width: 188px; display: none;'></div>" +
                        "<div class='gs-upload-ele-img-div'>"+
                        '<img src="' + a[j] + '" style="width: 80px;height: 80px;"/>'+
                        "</div>	"+
                        "<div class='gs-upload-ele-content'>"+
                        "<div class='gs-upload-ele-title-div'></div>"+
                        "<div class='gs-upload-ele-menu'>"+
                        "</div></div></div></div></div>");
                }
            } else if (pinCode == "qtztimg") {
                let a = lists[0][0][i].data.split(",");
                for (let j = 0; j < a.length; j++) {
                    $("#uploader-list-qtztimg").append('<div id="pic" class="file-iteme">' +
                        '<div class="handle"><span class="layui-icon">点击删除</span></div>' +
                        "<div class='gs-upload-file-container'>"+
                        "<div class='gs-upload-ele'>"+
                        "<div class='progress-bar progress-bar-success progress-bar-striped gs-upload-progress-bar' style='width: 188px; display: none;'></div>" +
                        "<div class='gs-upload-ele-img-div'>"+
                        '<img src="' + a[j] + '" style="width: 80px;height: 80px;"/>'+
                        "</div>	"+
                        "<div class='gs-upload-ele-content'>"+
                        "<div class='gs-upload-ele-title-div'></div>"+
                        "<div class='gs-upload-ele-menu'>"+
                        "</div></div></div></div></div>");
                }
            } else if (pinCode == "zztztimg") {
                let a = lists[0][0][i].data.split(",");
                for (let j = 0; j < a.length; j++) {
                    $("#uploader-list-zztztimg").append('<div id="pic" class="file-iteme">' +
                        '<div class="handle"><span class="layui-icon">点击删除</span></div>' +
                        "<div class='gs-upload-file-container'>"+
                        "<div class='gs-upload-ele'>"+
                        "<div class='progress-bar progress-bar-success progress-bar-striped gs-upload-progress-bar' style='width: 188px; display: none;'></div>" +
                        "<div class='gs-upload-ele-img-div'>"+
                        '<img src="' + a[j] + '" style="width: 80px;height: 80px;"/>'+
                        "</div>	"+
                        "<div class='gs-upload-ele-content'>"+
                        "<div class='gs-upload-ele-title-div'></div>"+
                        "<div class='gs-upload-ele-menu'>"+
                        "</div></div></div></div></div>");
                }
            } else if (pinCode == "cjztimg") {
                let a = lists[0][0][i].data.split(",");
                for (let j = 0; j < a.length; j++) {
                    $("#uploader-list-cjztimg").append( '<div id="pic" class="file-iteme">' +
                        '<div class="handle"><span class="layui-icon">点击删除</span></div>' +
                        "<div class='gs-upload-file-container'>"+
                        "<div class='gs-upload-ele'>"+
                        "<div class='progress-bar progress-bar-success progress-bar-striped gs-upload-progress-bar' style='width: 188px; display: none;'></div>" +
                        "<div class='gs-upload-ele-img-div'>"+
                        ' <img src="' + a[j] + '" style="width: 80px;height: 80px;"/>'+
                        "</div>	"+
                        "<div class='gs-upload-ele-content'>"+
                        "<div class='gs-upload-ele-title-div'></div>"+
                        "<div class='gs-upload-ele-menu'>"+
                        "</div></div></div></div></div>");
                }
            }
        }
        ;
        setTimeout(() => {
            //图片预览
            layer.photos({
                photos: '.layui-upload-list',
                anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
            });
        }, 300)
    });

    $('#past').click(function () {
        layer.open({
            area: ['300px', '250px'],
            title: '审核',
            btn: ['通过', '取消'],
            btnAlign: 'c',
            type: 1,
            async: false,
            content: ' <div style="text-align:center;" id="div">\n' +
                ' <span class="span" style="line-height: 150px;">确认通过嘛？</span>\n' +
                ' </div>',
            yes: function (index, layero) {
                shenHe(1, id);
                layer.close(index);
            },
            btn2: function (index, layero,) {
                layer.close(index);
            },
        });
    });
    $('#reject').click(function () {
        layer.open({
            area: ['300px', '250px'],
            title: '审核',
            btn: ['驳回', '取消'],
            btnAlign: 'c',
            type: 1,
            async: false,
            content: '<div style="text-align:center;" id="div">\n' +
                ' <span class="span" style="line-height: 150px;">确认驳回嘛？</span>\n' +
                ' <textarea type="text" hidden class="input" id="reason" placeholder="请填写驳回理由" style="height: 100px;width: 92%;margin-top: 10px;padding-left: 5px;"></textarea>\n' +
                ' </div>',
            yes: function (index, layero) {
                if ($("#reason").val() == "" || $("#reason").val() == null) {
                    $('.span').hide();
                    $("#reason").show();
                    layer.msg('请填写驳回理由！', {icon: 2},);
                } else {
                    shenHe(0, id, $("#reason").val());
                    layer.close(index);
                }
            },
            btn2: function (index, layero,) {
                layer.close(index);
            },
        });
    });

    /**
     * 审核
     */
    function shenHe(data, id, reason) {
        let obj = {};
        obj.proId = id;
        obj.status = data;
        obj.taskId = 6;
        obj.content = reason;

        $.ajax({
            type: "post",
            url: "/taskStatus/audit",
            data: obj,
            async: false,
            success: function (rs) {
                if(rs.success){
                    if (data == 1) {
                        layer.msg('已确认！');
                    } else {
                        layer.msg('已驳回！');
                    }
                }else{
                    Feng.error(rs.message);
                }

                $('#past').hide();
                $('#reject').hide();
            }
        });
    };
    var _delay = false;
    $('#btnKeep').click(function () {
        if(_delay) {
            layer.msg('请勿多次点击提交！');
            return;
        };
        _delay = true;
        setTimeout(() =>{
            _delay = false
        },2000);
        var list = [];
        for (let i = 1; i < 43; i++) {
            var object = {};
            if (i == 1) {
                object.data = $("#itemAddress").val();
                object.proId = id;
                object.mouldId = "36";
                object.pinCode = "itemAddress"
            } else if (i == 2) {
                object.data = $("#kfry").val();
                object.pinCode = "kfry";
            } else if (i == 3) {
                object.data = $("#ry").val();
                object.pinCode = "ry";
            } else if (i == 4) {
                object.data = $("#sw").val();
                object.pinCode = "sw";
            } else if (i == 5) {
                object.data = $("#djr").val();
                object.pinCode = "djr";
            } else if (i == 6) {
                object.data = $("#swzl").val();
                object.pinCode = "swzl";
            } else if (i == 7) {
                object.data = $("#hxwmj").val();
                object.pinCode = "hxwmj";
            } else if (i == 8) {
                object.data = $("#zlTime").val();
                object.pinCode = "zlTime";
            } else if (i == 9) {
                object.data = $("#zlTime1").val();
                object.pinCode = "zlTime1";
            } else if (i == 10) {
                object.data = $("#mzTime").val();
                object.pinCode = "mzTime";
            } else if (i == 11) {
                object.data = $("#mzTime1").val();
                object.pinCode = "mzTime1";
            } else if (i == 12) {
                object.data = $("#oneYear").val();
                object.pinCode = "oneYear";
            } else if (i == 13) {
                object.data = $("#twoYear").val();
                object.pinCode = "twoYear";
            } else if (i == 14) {
                object.data = $("#treeYear").val();
                object.pinCode = "treeYear";
            } else if (i == 15) {
                object.data = $("#foreYear").val();
                object.pinCode = "foreYear";
            } else if (i == 16) {
                object.data = $("#fiveYear").val();
                object.pinCode = "fiveYear";
            } else if (i == 17) {
                object.data = $("#sixYear").val();
                object.pinCode = "sixYear";
            } else if (i == 18) {
                object.data = $("#sevenYear").val();
                object.pinCode = "sevenYear";
            } else if (i == 19) {
                object.data = $("#eightYear").val();
                object.pinCode = "eightYear";
            } else if (i == 20) {
                object.data = $("#nineYear").val();
                object.pinCode = "nineYear";
            } else if (i == 21) {
                object.data = $("#tenYear").val();
                object.pinCode = "tenYear";
            } else if (i == 22) {
                object.data = $("#ccxs").val();
                object.pinCode = "ccxs";
            } else if (i == 23) {
                object.data = $("#qt").val();
                object.pinCode = "qt";
            } else if (i == 24) {
                object.data = $("#sf").val();
                object.pinCode = "sf";
            } else if (i == 25) {
                object.data = $("#df").val();
                object.pinCode = "df";
            } else if (i == 26) {
                object.data = $("#wz").val();
                object.pinCode = "wz";
            } else if (i == 27) {
                object.data = $("#zj").val();
                object.pinCode = "zj";
            } else if (i == 28) {
                object.data = $("#wz1").val();
                object.pinCode = "wz1";
            } else if (i == 29) {
                object.data = $("#zj1").val();
                object.pinCode = "zj1";
            } else if (i == 30) {
                object.data = $("#wz2").val();
                object.pinCode = "wz2";
            } else if (i == 31) {
                object.data = $("#zj2").val();
                object.pinCode = "zj2";
            } else if (i == 32) {
                object.data = $("#wz3").val();
                object.pinCode = "wz3";
            } else if (i == 33) {
                object.data = $("#zj3").val();
                object.pinCode = "zj3";
            } else if (i == 34) {
                object.data = $("#remarks").val();
                object.pinCode = "remarks";
            } else if (i == 35) {
                object.data = $("#wuyf").val();
                object.pinCode = "wuyf";
            } else if (i == 36) {
                object.data = $("#bzj").val();
                object.pinCode = "bzj";
            } else if (i == 37) {
                object.data = $("#zlbzj").val();
                object.pinCode = "zlbzj";
            } else if (i == 38) {
                object.data = $("#wybzj").val();
                object.pinCode = "wybzj";
            } else if (i == 39) {
                object.data = $("#qtbzj").val();
                object.pinCode = "qtbzj";
            } else if (i == 40) {
                object.data = $("#zswztimg").val();
                object.pinCode = "zswztimg";
            } else if (i == 41) {
                object.data = $("#btwpztimg").val();
                object.pinCode = "btwpztimg";
            } else if (i == 42) {
                object.data = $("#qtztimg").val();
                object.pinCode = "qtztimg";
            } else if (i == 43) {
                object.data = $("#zztztimg").val();
                object.pinCode = "zztztimg";
            } else if (i == 44) {
                object.data = $("#cjztimg").val();
                object.pinCode = "cjztimg";
            }
            object.sort = i;
            list.push(object);
        }
        var itemAddress = $('#itemAddress').val();
        var kfry = $('#kfry').val();
        var ry = $('#ry').val();
        var sw = $('#sw').val();
        var djr = $('#djr').val();
        var swzl = $('#swzl').val();
        var hxwmj = $('#hxwmj').val();
        var zlTime = $('#zlTime').val();
        var mzTime = $('#mzTime').val();
        var oneYear = $('#oneYear').val();
        var twoYear = $('#twoYear').val();
        var treeYear = $('#treeYear').val();
        var ccxs = $('#ccxs').val();
        var qt = $('#qt').val();
        var sf = $('#sf').val();
        var df = $('#df').val();
        var wuyf = $('#wuyf').val();
        var bzj = $('#bzj').val();
        var zlbzj = $('#zlbzj').val();
        var wybzj = $('#wybzj').val();
        var qtbzj = $('#qtbzj').val();
        var zswztimg = $('#zswztimg').val();

        if (itemAddress == '') {
            $('#itemAddress').addClass('blur');
            layer.msg('项目地址不能为空！', {icon: 2,});
            return
        } else if (zswztimg == '') {
            layer.msg('请上传落位图！', {icon: 2,});
            return
        } else if (kfry == '') {
            $('#kfry').addClass('blur');
            $('#itemAddress').removeClass("blur");
            layer.msg('开发人姓名不能为空！', {icon: 2,});
            return
        } else if (ry == '') {
            $('#ry').addClass('blur');
            $('#kfry').removeClass("blur");
            layer.msg('开发人电话不能为空！', {icon: 2,});
            return
        } else if (sw == '') {
            $('#sw').addClass('blur');
            $('#ry').removeClass("blur");
            layer.msg('招商负责人姓名不能为空！', {icon: 2,});
            return
        } else if (djr == '') {
            $('#djr').addClass('blur');
            $('#sw').removeClass("blur");
            layer.msg('招商负责人电话不能为空！', {icon: 2,});
            return
        } else if (swzl == '') {
            $('#swzl').addClass('blur');
            $('#djr').removeClass("blur");
            layer.msg('租赁面积不能为空！', {icon: 2,});
            return
        } else if (hxwmj == '') {
            $('#hxwmj').addClass('blur');
            $('#swzl').removeClass("blur");
            layer.msg('外摆区面积不能为空！', {icon: 2,});
            return
        } else if (zlTime == '') {
            $('#zlTime').addClass('blur');
            $('#hxwmj').removeClass("blur");
            layer.msg('租赁时间不能为空！', {icon: 2,});
            return
        } else if (mzTime == '') {
            $('#mzTime').addClass('blur');
            $('#zlTime').removeClass("blur");
            layer.msg('免租时间不能为空！', {icon: 2,});
            return
        } else if (oneYear == '') {
            $('#oneYear').addClass('blur');
            $('#mzTime').removeClass("blur");
            layer.msg('租金不能低于3年！', {icon: 2,});
            return
        } else if (twoYear == '') {
            $('#twoYear').addClass('blur');
            $('#oneYear').removeClass("blur");
            layer.msg('租金不能低于3年！', {icon: 2,});
            return
        } else if (treeYear == '') {
            $('#treeYear').addClass('blur');
            $('#twoYear').removeClass("blur");
            layer.msg('租金不能低于3年！', {icon: 2,});
            return
        } else if (ccxs == '') {
            $('#ccxs').addClass('blur');
            $('#treeYear').removeClass("blur");
            layer.msg('抽成形式不能为空！', {icon: 2,});
            return
        } else if (qt == '') {
            $('#qt').addClass('blur');
            $('#ccxs').removeClass("blur");
            layer.msg('其他形式不能为空！', {icon: 2,});
            return
        } else if (sf == '') {
            $('#sf').addClass('blur');
            $('#qt').removeClass("blur");
            layer.msg('水费不能为空！', {icon: 2,});
            return
        } else if (df == '') {
            $('#df').addClass('blur');
            $('#sf').removeClass("blur");
            layer.msg('电费不能为空！', {icon: 2,});
            return
        } else if (wuyf == '') {
            $('#wuyf').addClass('blur');
            $('#df').removeClass("blur");
            layer.msg('物业费不能为空！', {icon: 2,});
            return
        } else if (bzj == '') {
            $('#bzj').addClass('blur');
            $('#wuyf').removeClass("blur");
            layer.msg('保证金不能为空！', {icon: 2,});
            return
        } else if (zlbzj == '') {
            $('#zlbzj').addClass('blur');
            $('#bzj').removeClass("blur");
            layer.msg('租赁保证金不能为空！', {icon: 2,});
            return
        } else if (wybzj == '') {
            $('#wybzj').addClass('blur');
            $('#zlbzj').removeClass("blur");
            layer.msg('物业保证金不能为空！', {icon: 2,});
            return
        } else if (qtbzj == '') {
            $('#qtbzj').addClass('blur');
            $('#wybzj').removeClass("blur");
            layer.msg('其他保证金不能为空！', {icon: 2,});
            return
        } else {
            $.ajax({
                type: "post",
                url: "/mouldBoardMsg/add",
                data: JSON.stringify(list),
                contentType: 'application/json',
                async: false,
                success: function () {
                    list = [];
                    localStorage.clear();
                    layer.msg('保存成功！', {icon: 1});
                    window.location.href = Feng.ctxPath + '/project'
                }
            });
        }
    });

    $('#wuyf').focus(function () {
        $('#wuyf').css('background', '#e1e2e6')
    });
    $('#wuyf').blur(function () {
        $('#wuyf').css('background', '#ffff')
    });

    $('#bzj').focus(function () {
        $('#bzj').css('background', '#e1e2e6')
    });
    $('#bzj').blur(function () {
        $('#bzj').css('background', '#ffff')
    });
    $('#zlbzj').focus(function () {
        $('#zlbzj').css('background', '#e1e2e6')
    });
    $('#zlbzj').blur(function () {
        $('#zlbzj').css('background', '#ffff')
    });

    $('#wybzj').focus(function () {
        $('#wybzj').css('background', '#e1e2e6')
    });
    $('#wybzj').blur(function () {
        $('#wybzj').css('background', '#ffff')
    });
    $('#qtbzj').focus(function () {
        $('#qtbzj').css('background', '#e1e2e6')
    });
    $('#qtbzj').blur(function () {
        $('#qtbzj').css('background', '#ffff')
    });


    $('#itemAddress').focus(function () {
        $('#itemAddress').css('background', '#e1e2e6')
    });
    $('#itemAddress').blur(function () {
        $('#itemAddress').css('background', '#ffff')
    });
    $('#kfry').focus(function () {
        $('#kfry').css('background', '#e1e2e6')
    });
    $('#kfry').blur(function () {
        $('#kfry').css('background', '#ffff')
    });
    $('#ry').focus(function () {
        $('#ry').css('background', '#e1e2e6')
    });
    $('#ry').blur(function () {
        $('#ry').css('background', '#ffff')
    });

    $('#sw').focus(function () {
        $('#sw').css('background', '#e1e2e6')
    });
    $('#sw').blur(function () {
        $('#sw').css('background', '#ffff')
    });

    $('#djr').focus(function () {
        $('#djr').css('background', '#e1e2e6')
    });
    $('#djr').blur(function () {
        $('#djr').css('background', '#ffff')
    });

    $('#swzl').focus(function () {
        $('#swzl').css('background', '#e1e2e6')
    });
    $('#swzl').blur(function () {
        $('#swzl').css('background', '#ffff')
    });

    $('#hxwmj').focus(function () {
        $('#hxwmj').css('background', '#e1e2e6')
    });
    $('#hxwmj').blur(function () {
        $('#hxwmj').css('background', '#ffff')
    });

    $('#zlTime').focus(function () {
        $('#zlTime').css('background', '#e1e2e6')
    });
    $('#zlTime').blur(function () {
        $('#zlTime').css('background', '#ffff')
    });
    $('#leasetime1').blur(function () {
        $('#leasetime1').css('background', '#ffff')
    });

    $('#mzTime').focus(function () {
        $('#mzTime').css('background', '#e1e2e6')
    });
    $('#freetime1').focus(function () {
        $('#freetime1').css('background', '#e1e2e6')
    });
    $('#freetime').blur(function () {
        $('#freetime').css('background', '#ffff')
    });

    $('#oneYear').focus(function () {
        $('#oneYear').css('background', '#e1e2e6')
    });
    $('#oneYear').blur(function () {
        $('#oneYear').css('background', '#ffff')
    });

    $('#twoYear').focus(function () {
        $('#twoYear').css('background', '#e1e2e6')
    });
    $('#twoYear').blur(function () {
        $('#twoYear').css('background', '#ffff')
    });

    $('#treeYear').focus(function () {
        $('#treeYear').css('background', '#e1e2e6')
    });
    $('#treeYear').blur(function () {
        $('#treeYear').css('background', '#ffff')
    });

    $('#foreYear').focus(function () {
        $('#foreYear').css('background', '#e1e2e6')
    });
    $('#foreYear').blur(function () {
        $('#foreYear').css('background', '#ffff')
    });

    $('#fiveYear').focus(function () {
        $('#fiveYear').css('background', '#e1e2e6')
    });
    $('#fiveYear').blur(function () {
        $('#fiveYear').css('background', '#ffff')
    });

    $('#sixYear').focus(function () {
        $('#sixYear').css('background', '#e1e2e6')
    });
    $('#sixYear').blur(function () {
        $('#sixYear').css('background', '#ffff')
    });

    $('#sevenYear').focus(function () {
        $('#sevenYear').css('background', '#e1e2e6')
    });
    $('#sevenYear').blur(function () {
        $('#sevenYear').css('background', '#ffff')
    });
    $('#eightYear').focus(function () {
        $('#eightYear').css('background', '#e1e2e6')
    });
    $('#eightYear').blur(function () {
        $('#eightYear').css('background', '#ffff')
    });


    $('#nineYear').focus(function () {
        $('#nineYear').css('background', '#e1e2e6')
    });
    $('#nineYear').blur(function () {
        $('#nineYear').css('background', '#ffff')
    });

    $('#tenYear').focus(function () {
        $('#tenYear').css('background', '#e1e2e6')
    });
    $('#tenYear').blur(function () {
        $('#tenYear').css('background', '#ffff')
    });

    $('#ccxs').focus(function () {
        $('#ccxs').css('background', '#e1e2e6')
    });
    $('#ccxs').blur(function () {
        $('#ccxs').css('background', '#ffff')
    });

    $('#qt').focus(function () {
        $('#qt').css('background', '#e1e2e6')
    });
    $('#qt').blur(function () {
        $('#qt').css('background', '#ffff')
    });

    $('#sf').focus(function () {
        $('#sf').css('background', '#e1e2e6')
    });
    $('#sf').blur(function () {
        $('#sf').css('background', '#ffff')
    });

    $('#wz').focus(function () {
        $('#wz').css('background', '#e1e2e6')
    });
    $('#wz').blur(function () {
        $('#wz').css('background', '#ffff')
    });

    $('#wz1').focus(function () {
        $('#wz1').css('background', '#e1e2e6')
    });
    $('#wz1').blur(function () {
        $('#wz1').css('background', '#ffff')
    });

    $('#wz2').focus(function () {
        $('#wz2').css('background', '#e1e2e6')
    });
    $('#wz2').blur(function () {
        $('#wz2').css('background', '#ffff')
    });

    $('#wz3').focus(function () {
        $('#wz3').css('background', '#e1e2e6')
    });
    $('#wz3').blur(function () {
        $('#wz3').css('background', '#ffff')
    });

    $('#zj').focus(function () {
        $('#zj').css('background', '#e1e2e6')
    });
    $('#zj').blur(function () {
        $('#zj').css('background', '#ffff')
    });
    $('#zj1').focus(function () {
        $('#zj1').css('background', '#e1e2e6')
    });
    $('#zj1').blur(function () {
        $('#zj1').css('background', '#ffff')
    });
    $('#zj2').focus(function () {
        $('#zj2').css('background', '#e1e2e6')
    });
    $('#zj2').blur(function () {
        $('#zj2').css('background', '#ffff')
    });
    $('#zj3').focus(function () {
        $('#zj3').css('background', '#e1e2e6')
    });
    $('#zj3').blur(function () {
        $('#zj3').css('background', '#ffff')
    });
    $('#remarks').focus(function () {
        $('#remarks').css('background', '#e1e2e6')
    });
    $('#remarks').blur(function () {
        $('#remarks').css('background', '#ffff')
    });
</script>

@}